const HtmlWebpackPlugin = require('html-webpack-plugin');

let configPlugins =[];
let pageArr = [
  'home/home',
  'other/other'
];
pageArr.forEach((page) => {
   debugger;
    const htmlPlugin = new HtmlWebpackPlugin({
    //   filename: `${page}/${page}.html`,
    //   template: path.resolve(dirVars.pagesDir, `./${page}/html.js`),
    //  title: `${page}`,
    //   chunks: [page],
      inject: 'head',
      hash: true, // 为静态资源生成hash值
    //   minify: true,
    //   xhtml: true,
   
  filename: __dirname + "/dist/ [page].html", //输出路径和文件名

     template: 'html-withimg-loader!'+__dirname + "/src/pages/ [page].html",
    //  inlineSource: '.(js|css)$' 
    });
    configPlugins.push(htmlPlugin);
  });

  exports =  {
  configPlugins
}